<?php

/**
 * TentVersion form base class.
 *
 * @method TentVersion getObject() Returns the current form's model object
 *
 * @package    BuLaBuSys2013
 * @subpackage form
 * @author     Maximilian Lenkeit
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class BaseTentVersionForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'         => new sfWidgetFormInputHidden(),
      'type'       => new sfWidgetFormChoice(array('choices' => array('a' => 'a', 'k' => 'k', 'j' => 'j', 'h' => 'h'))),
      'capacity'   => new sfWidgetFormInputText(),
      'booking_id' => new sfWidgetFormInputText(),
      'created_at' => new sfWidgetFormInputText(),
      'updated_at' => new sfWidgetFormInputText(),
      'deleted_at' => new sfWidgetFormInputText(),
      'created_by' => new sfWidgetFormInputText(),
      'updated_by' => new sfWidgetFormInputText(),
      'deleted_by' => new sfWidgetFormInputText(),
      'version'    => new sfWidgetFormInputHidden(),
    ));

    $this->setValidators(array(
      'id'         => new sfValidatorChoice(array('choices' => array($this->getObject()->get('id')), 'empty_value' => $this->getObject()->get('id'), 'required' => false)),
      'type'       => new sfValidatorChoice(array('choices' => array(0 => 'a', 1 => 'k', 2 => 'j', 3 => 'h'), 'required' => false)),
      'capacity'   => new sfValidatorInteger(array('required' => false)),
      'booking_id' => new sfValidatorInteger(),
      'created_at' => new sfValidatorPass(array('required' => false)),
      'updated_at' => new sfValidatorPass(array('required' => false)),
      'deleted_at' => new sfValidatorPass(array('required' => false)),
      'created_by' => new sfValidatorInteger(array('required' => false)),
      'updated_by' => new sfValidatorInteger(array('required' => false)),
      'deleted_by' => new sfValidatorInteger(array('required' => false)),
      'version'    => new sfValidatorChoice(array('choices' => array($this->getObject()->get('version')), 'empty_value' => $this->getObject()->get('version'), 'required' => false)),
    ));

    $this->widgetSchema->setNameFormat('tent_version[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'TentVersion';
  }

}
